#include "Blocks/WireBlock.h"

namespace PocketSurvival
{
    WireBlock::WireBlock()
    {
        addInheritance((IPaintableBlock*)this);
    }

    void WireBlock::getCreativeValues(std::vector<int32_t> &blockVec)
    {
		blockVec.push_back(Terrain::MakeBlockValue(133));
		blockVec.push_back(Terrain::MakeBlockValue(133, 0, SetColor(0, 0)));
		blockVec.push_back(Terrain::MakeBlockValue(133, 0, SetColor(0, 8)));
		blockVec.push_back(Terrain::MakeBlockValue(133, 0, SetColor(0, 15)));
		blockVec.push_back(Terrain::MakeBlockValue(133, 0, SetColor(0, 11)));
		blockVec.push_back(Terrain::MakeBlockValue(133, 0, SetColor(0, 12)));
		blockVec.push_back(Terrain::MakeBlockValue(133, 0, SetColor(0, 13)));
		blockVec.push_back(Terrain::MakeBlockValue(133, 0, SetColor(0, 14)));
    }

    void WireBlock::getDropValues(int32_t oldValue, int32_t newValue, int32_t toolLevel, std::vector<BlockDropValue> &dropValues)
    {
    }

    BlockPlacementData WireBlock::getPlacementValue(ComponentMiner *componentMiner, int32_t value, const TerrainRaycastResult &raycastResult)
    {
		BlockPlacementData result;
		result.value = 0;
		result.cellFace = raycastResult.cellFace;
		return result;
    }

    const std::vector<BoundingBox> &WireBlock::getCustomCollisionBoxes(int32_t value)
    {
        return BlockConstans::zeroCollisionBoxes;
    }

    int32_t WireBlock::getPaintColor(int32_t value)
    {
        return GetColor(Terrain::ExtractData(value));
    }

    int32_t WireBlock::paint(int32_t value, int32_t color)
    {
        return Terrain::MakeBlockValue(getIndex(), 0, SetColor(Terrain::ExtractData(value), color));
    }

    int32_t WireBlock::getIndex()
    {
        return Index();
    }
    const std::string &WireBlock::getBlockName()
    {
        static std::string blockName = "WireBlock";
        return blockName;
    }
	
} // namespace PocketSurvival
